package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CollectionMapper;
import com.ruoyi.system.domain.Collections;
import com.ruoyi.system.service.ICollectionService;

/**
 * 收藏Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-04
 */
@Service
public class CollectionServiceImpl implements ICollectionService 
{
    @Autowired
    private CollectionMapper collectionMapper;

    /**
     * 查询收藏
     * 
     * @param collectionId 收藏主键
     * @return 收藏
     */
    @Override
    public Collections selectCollectionByCollectionId(Long collectionId)
    {
        return collectionMapper.selectCollectionByCollectionId(collectionId);
    }

    /**
     * 查询收藏列表
     * 
     * @param collection 收藏
     * @return 收藏
     */
    @Override
    public List<Collections> selectCollectionList(Collections collection)
    {
        return collectionMapper.selectCollectionList(collection);
    }

    /**
     * 新增收藏
     * 
     * @param collection 收藏
     * @return 结果
     */
    @Override
    public int insertCollection(Collections collection)
    {
        return collectionMapper.insertCollection(collection);
    }

    /**
     * 修改收藏
     * 
     * @param collection 收藏
     * @return 结果
     */
    @Override
    public int updateCollection(Collections collection)
    {
        return collectionMapper.updateCollection(collection);
    }

    /**
     * 批量删除收藏
     * 
     * @param collectionIds 需要删除的收藏主键
     * @return 结果
     */
    @Override
    public int deleteCollectionByCollectionIds(Long[] collectionIds)
    {
        return collectionMapper.deleteCollectionByCollectionIds(collectionIds);
    }

    /**
     * 删除收藏信息
     * 
     * @param collectionId 收藏主键
     * @return 结果
     */
    @Override
    public int deleteCollectionByCollectionId(Long collectionId)
    {
        return collectionMapper.deleteCollectionByCollectionId(collectionId);
    }
}
